package com.fiberhome.nas.feature.album.viewmodel

import androidx.lifecycle.SavedStateHandle
import com.fiberhome.nas.core.common.base.viewmodel.BaseNetWorkViewModel
import com.fiberhome.nas.core.data.repository.AlbumRepository
import com.fiberhome.nas.core.data.state.AppState
import com.fiberhome.nas.core.model.entity.AlbumInfo
import com.fiberhome.nas.core.model.entity.PhotoItem
import com.fiberhome.nas.core.model.response.ListData
import com.fiberhome.nas.core.model.response.NetworkResponse
import com.fiberhome.nas.feature.album.navigation.AlbumDetailRoutes
import com.fiberhome.nas.navigation.AppNavigator
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.flow
import javax.inject.Inject

@HiltViewModel
class AlbumDetailViewModel @Inject constructor(
    navigator: AppNavigator,
    appState: AppState,
    savedStateHandle: SavedStateHandle,
    private val albumRepository: AlbumRepository,
) : BaseNetWorkViewModel<ListData<PhotoItem>>(
    navigator = navigator,
    appState = appState,
    savedStateHandle = savedStateHandle,
) {

    val albumItem: AlbumInfo? = savedStateHandle[AlbumDetailRoutes.ALBUM_ITEM]

    private val _photos = MutableStateFlow<List<PhotoItem>>(emptyList())
    val photos: StateFlow<List<PhotoItem>> = _photos.asStateFlow()


    override fun requestApiFlow(): Flow<NetworkResponse<ListData<PhotoItem>>> {
//        return albumRepository.getPhotoList(id)
        return flow { }
    }

}




